Manages the images in the component. More...
Public Member Functions | |
Image * | createOrRetrieve (const nkMemory::StringView &name) |
Image * | get (const nkMemory::StringView &name) const |
Image * | getByIndex (unsigned int index) const |
void | rename (const nkMemory::StringView &oldName, const nkMemory::StringView &newName) |
void | erase (const nkMemory::StringView &name) |
Manages the images in the component.
Image* nkWinUi::ImageManager::createOrRetrieve | ( | const nkMemory::StringView & | name | ) |
Creates if unavailable, or retrieves if available, an image.
name | The name of the image to retrieve. |
Image* nkWinUi::ImageManager::get | ( | const nkMemory::StringView & | name | ) | const |
Retrieves an image.
name | The name of the image to retrieve. |
Image* nkWinUi::ImageManager::getByIndex | ( | unsigned int | index | ) | const |
Get an image, by index. Note that one index can map to a different image after memory is changed. Useful to loop over all available images in one go.
index | The index of the image to retrieve. |
void nkWinUi::ImageManager::rename | ( | const nkMemory::StringView & | oldName, |
const nkMemory::StringView & | newName | ||
) |
Renames an image.
oldName | The name of the image to rename. |
newName | The name to reassign to the image. |
void nkWinUi::ImageManager::erase | ( | const nkMemory::StringView & | name | ) |
Erases and frees an image.
name | The name of the image to erase. |